<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>编辑邮件</title>
<link href="/widget/bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet"  type="text/css"/>
 {cssjs}
<link href="/res/css/inside_page.css" rel="stylesheet"  type="text/css"/>
<script language="javascript" type="text/javascript" src="/widget/datepicker/WdatePicker.js"></script>
<style>
    #attachment_box{height: 36px;line-height: 36px}
    #attachment_box .attachment_one{display: inline-block;margin-right: 5px;color: #6C9EC0;}
    #attachment_box .attachment_one_del{display: inline-block;margin-right: 15px;color: #c00;}
    .layui-upload-button{float: left;width: 150px;}
    #attachment_box{float: left;width: 78%;margin-left: 20px;}
</style>
</head>
<body>
<div class="container-fluid larry-wrapper">
    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12">
            <section class="panel panel-padding">
            	<form id="form1" class="layui-form layui-form-pane"> 
                <div class="layui-form-item">
                    <div class="layui-input-inline" style="width:120px;">
                        <select name="type" id="type">
                            <option value="">请选择类型</option>
                            <!-- START types -->
                            <option value="{id}">{name}</option>
                            <!-- END types -->
                        </select>
                    </div>
                    <div class="layui-input-inline">
                        <input class="layui-input" placeholder="开始日期" name="start_time" value="{start_time}" id="start_time" type="text" onClick="WdatePicker()">为空为立即开始
                    </div> 
                    <div class="layui-input-inline" style="width:10px;text-align:center;line-height: 38px">-</div>                    
                    <div class="layui-input-inline">
                        <input class="layui-input" placeholder="结束日期" name="end_time" value="{end_time}" id="end_time" type="text" onClick="WdatePicker()">为空为手动结束
                    </div>
                </div>  
                <div class="layui-form-item">
                    <label class="layui-form-label">发布部门</label>
                    <div class="layui-input-block">
                        <input type="text" readonly placeholder="发布部门" title="" id="deptname" value="{deptname}" name="deptname" autocomplete="off" class="layui-input" style="display: inline-block;width:85%;">
                        <a class="layui-btn" href="javascript:void(0);" onclick="showDept()" style="display: inline-block;" title="添加通知对象">添加</a> 
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">发布人员</label>
                    <div class="layui-input-block">
                        <input type="text" readonly placeholder="发布人员" title="" id="acceptname" value="{acceptname}" name="acceptname" autocomplete="off" class="layui-input" style="display: inline-block;width:85%;">
                        <a class="layui-btn" href="javascript:void(0);" onclick="showAccept()" style="display: inline-block;" title="添加通知对象">添加</a> 
                    </div>
                </div> 
                <div class="layui-form-item">
                    <label class="layui-form-label">负责人员</label>
                    <div class="layui-input-block">
                        <input type="text" readonly placeholder="负责人员" title="" id="chargename" value="{chargename}" name="chargename" autocomplete="off" class="layui-input" style="display: inline-block;width:85%;">
                        <a class="layui-btn" href="javascript:void(0);" onclick="showCharge()" style="display: inline-block;" title="添加通知对象">添加</a> 
                    </div>
                </div>   
                <input type="hidden" name="dept_id" id="dept_id" value="{dept_id}">
                <input type="hidden" name="accept_id" id="accept_id" value="{accepter}">
                <input type="hidden" name="charge_id" id="charge_id" value="{charge_uid}">
                <input type="hidden" name="uid" id="uid" value="{uid}"> 
                <input type="hidden" name="id" id="id" value="{id}">
                <div class="layui-form-item">
                    <label class="layui-form-label">附&nbsp;&nbsp;&nbsp;件：</label>
                    <div class="layui-input-block">
                        <input type="file" id="upload_attachment" name="upload_attachment[]" multiple="true" lay-type="file" class="layui-upload-file"> 
                        <div id="attachment_box">
                            {attachment_html}
                        </div>
                        <input name="attachment" id="attachment" value='{attachment_arr}' type="text" style="display: none;">
                    </div>
                </div> 
                <div class="layui-form-item">
                    <label class="layui-form-label">名&nbsp;&nbsp;&nbsp;称：</label>
                    <div class="layui-input-block">
                        <input name="name" id="name" value='{name}' type="text" class="layui-input" placeholder="计划名称">
                    </div>
                </div>
                <div class="layui-form-item"></div>                    
				<textarea class="layui-textarea"  name="content"  id="content" style="display: none">{content}</textarea>
                <div class="layui-form-item"></div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备&nbsp;&nbsp;&nbsp;注：</label>
                    <div class="layui-input-block">
                        <textarea class="layui-textarea" name="remark" id="remark">{remark}</textarea>
                    </div>
                </div> 
                <div class="layui-form-item"></div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <input type="button" id="btn_save" value="确定" class="layui-btn" />
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
				</form>				
            </section>
        </div>
    </div>
</div>
    {jsmodel}
   <script type="text/javascript">
        layui.use('plan_edit');
        var type = '{type}';
        if(type)$('#type').val(type);
        var index = parent.layer.getFrameIndex(window.name);//获取当前弹出层的ID
        function showDept(){
            var deptid=$("#dept_id").val();
            //iframe层
              parent.layer.open({
              type: 2,
              title: '选择发布部门',
              shadeClose: true,
              shade: 0.8,
              area: ['100%','100%'],
              content: './?t=select_dept&fid='+index+'&deptid='+deptid //iframe的url
            }); 
        }
        function showAccept(){
            var userid=$("#accept_id").val();
            //iframe层
              parent.layer.open({
              type: 2,
              title: '选择发布人员',
              shadeClose: true,
              shade: 0.8,
              area: ['100%','100%'],
              content: './?t=select_accept&fid='+index+'&userid='+userid //iframe的url
            }); 
        }
        function showCharge(){
            var userid=$("#charge_id").val();
            //iframe层
              parent.layer.open({
              type: 2,
              title: '选择负责人员',
              shadeClose: true,
              shade: 0.8,
              area: ['100%','100%'],
              content: './?t=select_charge&fid='+index+'&userid='+userid //iframe的url
            }); 
        }
    </script>
</body>
</html>